﻿namespace Furesoft.Styling.Design
{
    using System.Collections.Generic;
    using System.Drawing;

    using FastColoredTextBoxNS;

    public class StyleManager
    {
        #region Static Fields

        public static readonly List<FastColoredTextBoxNS.Style> Styles = new List<FastColoredTextBoxNS.Style>();

        public static readonly Dictionary<string, FastColoredTextBoxNS.Style> patterns = new Dictionary<string, FastColoredTextBoxNS.Style>();

        #endregion

        #region Public Methods and Operators

        public static void Add(string pattern, Brush color, FontStyle style)
        {
            var s = new TextStyle(color, Brushes.White, style);
            if (!Styles.Contains(s))
            {
                Styles.Add(s);
            }
            if (!patterns.ContainsKey(pattern))
            {
                patterns.Add(pattern, s);
            }
        }
        public static void Add(string pattern, FastColoredTextBoxNS.Style st)
        {
            if (!Styles.Contains(st))
            {
                Styles.Add(st);
            }
            if (!patterns.ContainsKey(pattern))
            {
                patterns.Add(pattern, st);
            }
        }

        #endregion
    }
}